package com.ruoyi.game.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.game.domain.GameReplay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.game.mapper.GameReplayMapper;
import com.ruoyi.game.service.IGameReplayService;

/**
 * 牌局回放Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-18
 */
@Service
public class GameReplayServiceImpl implements IGameReplayService 
{
    @Autowired
    private GameReplayMapper gameReplayMapper;

    /**
     * 查询牌局回放
     * 
     * @param id 牌局回放主键
     * @return 牌局回放
     */
    @Override
    public GameReplay selectGameReplayById(Long id)
    {
        return gameReplayMapper.selectGameReplayById(id);
    }

    /**
     * 查询牌局回放列表
     * 
     * @param gameReplay 牌局回放
     * @return 牌局回放
     */
    @Override
    public List<GameReplay> selectGameReplayList(GameReplay gameReplay)
    {
        return gameReplayMapper.selectGameReplayList(gameReplay);
    }

    /**
     * 新增牌局回放
     * 
     * @param gameReplay 牌局回放
     * @return 结果
     */
    @Override
    public int insertGameReplay(GameReplay gameReplay)
    {
        gameReplay.setCreateTime(DateUtils.getNowDate());
        return gameReplayMapper.insertGameReplay(gameReplay);
    }

    /**
     * 修改牌局回放
     * 
     * @param gameReplay 牌局回放
     * @return 结果
     */
    @Override
    public int updateGameReplay(GameReplay gameReplay)
    {
        gameReplay.setUpdateTime(DateUtils.getNowDate());
        return gameReplayMapper.updateGameReplay(gameReplay);
    }

    /**
     * 批量删除牌局回放
     * 
     * @param ids 需要删除的牌局回放主键
     * @return 结果
     */
    @Override
    public int deleteGameReplayByIds(Long[] ids)
    {
        return gameReplayMapper.deleteGameReplayByIds(ids);
    }

    /**
     * 删除牌局回放信息
     * 
     * @param id 牌局回放主键
     * @return 结果
     */
    @Override
    public int deleteGameReplayById(Long id)
    {
        return gameReplayMapper.deleteGameReplayById(id);
    }
}
